<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>onload onbeforeunload onresize</title>
    <script type="text/javascript">
        window.onload=function () {
            alert("欢迎！");
            window.onbeforeunload=function () {
                alert("再见！");
            };
            window.onresize=function () {
                alert("你改变了窗口的大小");
            }
        }
    </script>
</head>
<body>

</body>
</html>